///@file Cylinder.cpp
///@brief Implementation of the class representing a cylinder
///@author Arnaud Duval
///@version 0.0
///@date 2010/03/05

#include "../include/Cylinder.h"
#include <cmath>

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

///@brief Default constructor
Cylinder::Cylinder()
{

}

///@brief Constructor with arguments
///@param Dp1 First point defining the axis
///@param Dp2 Second point defining the axis
///@param Dr radius
Cylinder::Cylinder(Point Dp1, Point Dp2, double Dr)
{
	p1 = Dp1;
	p2 = Dp2;
	radius = Dr;
}

///@brief Destructor
Cylinder::~Cylinder()
{

}

///@brief Compute volume value
double Cylinder::value()
{
	return Distance(p1,p2) * M_PI * pow(radius, 2.);
}
